home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Jumpstart / Multimedia Microsoft Jumpstart Version 1.1a (Microsoft).BIN / develpmt / source / cropdib / dib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-12  |  2.6 KB  |  58 lines

  1. /*----------------------------------------------------------------------------*\
  2. |   Routines for dealing with Device independent bitmaps                       |
  3. |                                                                              |
  4. |                                                                              |
  5. \*----------------------------------------------------------------------------*/
  6.  
  7. HANDLE      OpenDIB(int fh);
  8. BOOL        WriteDIB(int fh,HANDLE hdib);
  9. WORD        PaletteSize(VOID FAR * pv);
  10. WORD        DibNumColors(VOID FAR * pv);
  11. HPALETTE    CreateDibPalette(HANDLE hdib);
  12. HPALETTE    CreateBIPalette(LPBITMAPINFOHEADER lpbi);
  13. HANDLE      DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
  14. HANDLE      DibFromDib(HANDLE hdib, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
  15. HANDLE      BitmapFromDib(HANDLE hdib, HPALETTE hpal, WORD wUsage);
  16. BOOL        SetDibUsage(HANDLE hdib, HPALETTE hpal,WORD wUsage);
  17. BOOL        DibInfo(HANDLE hdib,LPBITMAPINFOHEADER lpbi);
  18. HANDLE      ReadDibBitmapInfo(int fh);
  19. BOOL        SetPalFlags(HPALETTE hpal, int iIndex, int cntEntries, WORD wFlags);
  20. BOOL        PalEq(HPALETTE hpal1, HPALETTE hpal2);
  21.  
  22. BOOL        DrawBitmap(HDC hdc, int x, int y, HBITMAP hbm, DWORD rop);
  23. BOOL        StretchBitmap(HDC hdc, int x, int y, int dx, int dy, HBITMAP hbm, int x0, int y0, int dx0, int dy0, DWORD rop);
  24.  
  25. BOOL        DibBlt(HDC hdc, int x0, int y0, int dx, int dy, HANDLE hdib, int x1, int y1, LONG rop, WORD wUsage);
  26. BOOL        StretchDibBlt(HDC hdc, int x, int y, int dx, int dy, HANDLE hdib, int x0, int y0, int dx0, int dy0, LONG rop, WORD wUsage);
  27.  
  28. LPVOID      DibLock(HANDLE hdib,int x, int y);
  29. VOID        DibUnlock(HANDLE hdib);
  30. LPVOID      DibXY(LPBITMAPINFOHEADER lpbi,int x, int y);
  31. HANDLE      CreateDib(HANDLE hdib, int dx, int dy);
  32.  
  33. #define BFT_ICON   0x4349   /* 'IC' */
  34. #define BFT_BITMAP 0x4d42   /* 'BM' */
  35. #define BFT_CURSOR 0x5450   /* 'PT' */
  36.  
  37. #define ISDIB(bft) ((bft) == BFT_BITMAP)
  38. #define ALIGNULONG(i)   ((i+3)/4*4)        /* ULONG aligned ! */
  39. #define WIDTHBYTES(i)   ((i+31)/32*4)      /* ULONG aligned ! */
  40.  
  41. #define PALVERSION      0x300
  42. #define MAXPALETTE      256
  43.  
  44. extern int FAR PASCAL StretchDIBits (
  45.         HDC     hDC,
  46.         WORD    DestX,
  47.         WORD    DestY,
  48.         WORD    DestXE,
  49.         WORD    DestYE,
  50.         WORD    SrcX,
  51.         WORD    SrcY,
  52.         WORD    SrcXE,
  53.         WORD    SrcYE,
  54.         LPSTR   lpBitsBuffer,
  55.         LPBITMAPINFO    lpBitmapInfo,
  56.         WORD    wUsage,
  57.         DWORD   dwROP );
  58.